home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / em-xmkit.zip / EMM30_C.ASM < prev    next >
Assembly Source File  |  1989-11-29  |  5KB  |  94 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM30_C.ASM                                             ;
  3. ;                                                                             ;
  4. ; OS FUNCTION NAME:   return_OS_access_key                                    ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function provides an OS/E with the ability to      ;
  7. ;                     return the access key to the memory manager.  Returning ;
  8. ;                     the access key to the memory manager places the memory  ;
  9. ;                     manager in the state it is in at installation time      ;
  10. ;                     (regarding the use of the OS/E function set and the     ;
  11. ;                     access key).  That is, access to the OS/E function set  ;
  12. ;                     is enabled.  Upon execution of the next enable/disable  ;
  13. ;                     OS/E function set function, the access key will once    ;
  14. ;                     again be returned.                                      ;
  15. ;                                                                             ;
  16. ;                     The OS/E (Operating System) functions which are         ;
  17. ;                     affected by this function are:                          ;
  18. ;                        get_hw_info               enable_DMA_reg_set         ;
  19. ;                        get_alt_reg_set           disable_DMA_reg_set        ;
  20. ;                        set_alt_reg_set           dealloc_DMA_reg_set        ;
  21. ;                        get_alt_context_size      enable_OS_fcns             ;
  22. ;                        alloc_alt_reg_set         disable_OS_fcns            ;
  23. ;                        dealloc_alt_reg_set       return_OS_access_key       ;
  24. ;                        alloc_DMA_reg_set                                    ;
  25. ;                                                                             ;
  26. ;           PASSED:   &access_key:                                            ;
  27. ;                        is a far pointer to an EMM initialized access key    ;
  28. ;                        which was returned by the first function invocation  ;
  29. ;                        of the enable or disable functions.                  ;
  30. ;                                                                             ;
  31. ;         RETURNED:   status:                                                 ;
  32. ;                        is the status EMM returns from the call.  All other  ;
  33. ;                        returned results are valid only if the status        ;
  34. ;                        returned is zero.  Otherwise they are undefined.     ;
  35. ;                                                                             ;
  36. ; C USE CONVENTION:   unsigned int  status;                                   ;
  37. ;                     unsigned long access_key;                               ;
  38. ;                                                                             ;
  39. ;                     status = return_OS_access_key (&access_key);            ;
  40. ;-----------------------------------------------------------------------------;
  41. .XLIST
  42. PAGE    60,132
  43.  
  44. IFDEF SMALL
  45.    .MODEL SMALL, C
  46. ENDIF
  47. IFDEF MEDIUM
  48.    .MODEL MEDIUM, C
  49. ENDIF
  50. IFDEF LARGE
  51.    .MODEL LARGE, C
  52. ENDIF
  53. IFDEF COMPACT
  54.    .MODEL COMPACT, C
  55. ENDIF
  56. IFDEF HUGE
  57.    .MODEL HUGE, C
  58. ENDIF
  59.  
  60. INCLUDE emmlib.equ
  61. INCLUDE emmlib.str
  62. INCLUDE emmlib.mac
  63. .LIST
  64. .CODE
  65.  
  66. return_OS_access_key    PROC                                                  \
  67.                         USES DI,                                              \
  68.             ptr_access_key:FAR PTR DWORD
  69.  
  70.     ;---------------------------------------------------------------------;
  71.     ;   do;                                                               ;
  72.     ;   .   return the "access key" owned by the OS back to EMM for       ;
  73.     ;   .   EMMs future use;                                              ;
  74.     ;---------------------------------------------------------------------;
  75.     MOVE        AX, return_access_key_fcn
  76.         MOVE            ES:DI, ptr_access_key
  77.         MOVE            BX:CX, ES:[DI]
  78.     INT         EMM_int
  79.  
  80.         ;---------------------------------------------------------------------;
  81.         ;   .   pass the "access key" back to the OS;                         ;
  82.         ;---------------------------------------------------------------------;
  83.         MOVE            ES:[DI], BX:CX
  84.  
  85.     ;---------------------------------------------------------------------;
  86.     ;   .   return (EMM status);                                          ;
  87.     ;   end;                                                              ;
  88.     ;---------------------------------------------------------------------;
  89.     RET_EMM_STAT    AH
  90.  
  91. return_OS_access_key        ENDP
  92.  
  93. END
  94.